//: Playground - noun: a place where people can play

import UIKit

var str = "Hello, playground"

let a = 100;

let view = UIView();
let button = UIButton();

let m: Int;//没有保存内存地址
m = 20;//可以修改
//m = 30;

let n = 2.3;

//let o = m + n;//Error,类型要一致
let o = m + Int(n);

// guard的用法
// 适用于多个判断语句的嵌套使用
func online(age: Int, id: Bool, haveMoney: Bool) -> Void {
    guard age>18 else {
        print("回家")
        return;
    }
    
    guard id else {
        print("回家拿身份证")
        return;
    }
    
    guard haveMoney else {
        print("回家拿钱")
        return
    }
    
    print("留下来")
}

online(age: 19, id: true, haveMoney:false);



